package com.time.company.base;

import android.view.View;
import android.widget.PopupWindow;

/**
 * popupWindow 的基类
 * Created by Bing on 2016/8/23.
 * E-mail is tx16bing@163.com
 */
public class BasePW<T> extends PopupWindow{

    // Item点击的监听
    public OnItemClickListener<T> onItemClickListener;

    public BasePW(){
        // Nothing to do
    }

    public void setOnItemClickListener(OnItemClickListener<T> onItemClickListener) {
        this.onItemClickListener = onItemClickListener;
    }

    public interface OnItemClickListener<T> {
        void onItemClick(int type, T result);
    }

    // 初始化控件id
    protected <K extends View> K findView(int resId) {
        return (K) (getContentView().findViewById(resId));
    }

}
